<?php
header('Content-Type:application/json;charset=UTF-8');
include("../../com/website_config.php");

$orderID=$_GET['orderID'];
//echo ($orderID==="1");
$data=array();

switch($orderID){
    case "1":
        getCarSeats($db);
        break;
    case 2:
        break;
    default:
}

function getCarSeats($db){
    $SQL="SELECT car_seat,car_title FROM car GROUP BY car_seat desc";
    $record=$db->query($SQL);
//    var_dump(mysql_num_rows($record));
    if(!mysql_num_rows($record)){
        echo"暂时还没有信息!";
    }
    else
    {
        $i=0;$j=0;
        $data["car_seats"][$j]["car_seat"]="all";
        $data["car_seats"][$j++]["car_title"]="全部";
        while($array=mysql_fetch_array($record))
        {
            $data["car_seats"][$j]["car_seat"]= $array["car_seat"];
            $data["car_seats"][$j++]["car_title"]= $array["car_title"];
        }
    }
    echo json_encode($data);
}




?>